//
//  EFAMsgModel.h
//  efairy
//
//  Created by XiangDongMBP on 2017/7/31.
//  Copyright © 2017年 East. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <YYModel.h>

#pragma mark - 消息推送
@interface EFAMsgIMItem : NSObject
@property (nonatomic,copy)    NSString *msgId;                      //!<本地数据库id
@property (nonatomic,copy)    NSString *userId;                     //用户ids本地数据查询出来
@property (nonatomic,assign)  long msgAddTime;                 //!< 本地接受消息的时间戳
@property (nonatomic,assign)  NSInteger isRead;                     //!< 是否已读
@property (nonatomic, assign) NSInteger efairydevicemsg_id;         //!< 消息ID
@property (nonatomic, copy)   NSString *efairydevicemsg_from_id;    //!< 发送者ID
@property (nonatomic, copy)   NSString *efairydevicemsg_to_id;      //!< 接受者ID
@property (nonatomic, copy)   NSString *efairydevicemsg_uuid;       //!< 消息唯一ID
@property (nonatomic, copy)   NSString *efairydevice_name;          //!< 设备名称
@property (nonatomic, copy)   NSString *efairydevicemsg_time;       //!< 发送时间
@property (nonatomic, copy)   NSString *efairydevicemsg_content;    //!< 内容
@property (nonatomic, copy)   NSString *efairydevice_id;            //!< 设备id
@property (nonatomic, copy)   NSString *efairymsg_add_time;         //!< 消息生成时间
@property (nonatomic, copy)   NSString *efairymsg_class;
@property (nonatomic, copy)   NSString *efairymsg_content;          //!< 内容
@property (nonatomic, copy)   NSString *efairymsg_from_id;          //!<消息发起者（可能是设备或用户）
@property (nonatomic, copy)   NSString *efairymsg_id;               //!< 聊天编号
@property (nonatomic, copy)   NSString *efairymsg_sub_class;        //
@property (nonatomic, copy)   NSString *efairymsg_to_id;            //!<消息接受者
@property (nonatomic, copy)   NSString *efairymsg_time;
@property (nonatomic, copy)   NSString *efairymsg_msgtype;
@property (nonatomic, copy)   NSString *efairymsg_ishandle;
@property (nonatomic, assign) BOOL efairydevicemsg_ishandle;        //!< 是否已处理，0-未处理 1-已处理
@property (nonatomic, assign) BOOL efairydevicemsg_msgtype;         //!< 消息类型，0-不需要处理 1-需要处理

///< 自定义变量
@property (nonatomic, assign) BOOL isSelected;  ///< 是否选中
@end

@interface EFAMsgIMModel : NSObject
@property (nonatomic, assign) NSInteger total_rows;
@property (nonatomic, strong) NSMutableArray<EFAMsgIMItem *> *device_msglist;

@property (nonatomic, readonly) BOOL totalLoad;
@property (nonatomic, readonly) NSArray<EFAMsgIMItem *> *selectedMsgIMArray;
@property (nonatomic, readonly) NSArray<NSNumber *> *selectedMsgIMIdArray;
- (instancetype)initWithIMItemArray:(NSArray<EFAMsgIMItem *> *)array;
- (void)addMoreWithData:(EFAMsgIMModel *)temp;
- (void)insertMsgItem:(EFAMsgIMItem *)item;
- (void)insertMsgItemArray:(NSArray<EFAMsgIMItem *> *)array;
- (void)addMsgItem:(EFAMsgIMItem *)item;
- (BOOL)containsMsgWithMsgId:(NSInteger)msg_id;
- (void)removeAll;
- (void)clearAllSelected;
//- (void)changeAllSelectedWithUnhandleMsgArray:(NSArray<NSNumber *> *)array;
- (void)changeToHandleWithArray:(NSArray<EFAMsgIMItem *> *)array;
- (void)changeToHandleWithIdArray:(NSArray<NSNumber *> *)array;
@end

@interface EFAMsgUnhandleModel : NSObject
@property (nonatomic, assign) NSInteger total_rows;
@property (nonatomic, strong) NSMutableArray<NSNumber *> *unhandlemsg_list;

- (void)removeAll;
@end

#pragma mark - 设备配置
@class EFADevRealTimeDataItem;
@interface EFADeviceCfgModel : NSObject
@property (nonatomic, assign) NSInteger efairydevicesetting_heartbeat_interval;    ///< 心跳
@property (nonatomic, assign) NSInteger efairydevicesetting_audio_on;  ///< 音响模式 0-静音 1-正常
@property (nonatomic, strong) NSMutableArray<EFADevRealTimeDataItem *> *efairydevicesetting_thv_list;
@end

#pragma mark - 版本信息
@interface EFADevVersionItem : NSObject
@property (nonatomic, assign) NSInteger efairydeviceversion_id;          ///< 编号
@property (nonatomic, copy)   NSString *efairydeviceversion_version;     ///< 版本号
@property (nonatomic, copy)   NSString *efairydeviceversion_src_url;     ///< 版本资源链接
@property (nonatomic, copy)   NSString *efairydeviceversion_description; ///< 版本描述
@property (nonatomic, copy)   NSString *efairydeviceversion_add_time;    ///< 版本添加时间
@property (nonatomic, assign) NSInteger efairydeviceversion_companycode_id;  ///< 企业代码编号
@property (nonatomic, copy)   NSString *efairydevicecompanycode_name;        ///< 企业名称
@property (nonatomic, assign) NSInteger efairydeviceversion_usagecode_id;  ///< 用途代码编号
@property (nonatomic, copy)   NSString *efairydeviceusagecode_name;    ///< 用途
@end

@interface EFADevVersionModel : NSObject<YYModel>
@property (nonatomic, assign) NSInteger total_rows;
@property (nonatomic, strong) NSMutableArray<EFADevVersionItem *> *version_list;

@property (nonatomic, readonly) BOOL totalLoad;
@property (nonatomic, readonly) BOOL totalZero;
- (void)addMoreWithData:(EFADevVersionModel *)temp;
@end

#pragma mark - 企业代码列表
@interface EFACompanyCodeItem : NSObject
@property (nonatomic, assign) NSInteger efairydevicecompanycode_id;         ///< 编号
@property (nonatomic, assign) NSInteger efairydevicecompanycode_code;       ///< 企业代码编号
@property (nonatomic, copy)   NSString *efairydevicecompanycode_name;       ///< 企业名称
@property (nonatomic, copy)   NSString *efairydevicecompanycode_description;///< 版本添加时间
@property (nonatomic, copy)   NSString *efairydevicecompanycode_add_time;   ///< 版本描述
@end

@interface EFACompanyCodeModel : NSObject<YYModel>
@property (nonatomic, assign) NSInteger total_rows;
@property (nonatomic, strong) NSMutableArray<EFACompanyCodeItem *> *companycode_list;

@property (nonatomic, readonly) BOOL totalLoad;
- (void)addMoreWithData:(EFACompanyCodeModel *)temp;
@end

#pragma mark - 用途代码列表
@interface EFAUsageCodeItem : NSObject
@property (nonatomic, assign) NSInteger efairydeviceusagecode_id;         ///< 用途代码编号
@property (nonatomic, assign) NSInteger efairydeviceusagecode_code;       ///< 用途代码
@property (nonatomic, copy)   NSString *efairydeviceusagecode_name;       ///< 用途名称
@property (nonatomic, copy)   NSString *efairydeviceusagecode_discription;///< 用途描述
@property (nonatomic, copy)   NSString *efairydeviceusagecode_add_time;   ///< 添加时间
@end

@interface EFAUsageCodeModel : NSObject<YYModel>
@property (nonatomic, assign) NSInteger total_rows;
@property (nonatomic, strong) NSMutableArray<EFAUsageCodeItem *> *usagecode_list;

@property (nonatomic, readonly) BOOL totalLoad;
- (void)addMoreWithData:(EFAUsageCodeModel *)temp;
@end


@interface EFAMsgModel : NSObject

@end
